import {GET, POST} from "@/apis";
import {BookConfig} from "@/apis/recommend";

/* 图书评分 */
export const setBookScore = (bookId: string, score: number) => POST<boolean>(`/books/setScore/${bookId}/${score}`)

/* 搜索节点 */
export const searchNode = (value: string, size: number) => GET<BookConfig[]>(`/books/search?searchValue=${value}&size=${size}`)

/* 搜索数书籍 */
export const searchBooks = (abortController: AbortController, value: string, size: number) => GET<BookConfig[]>({
    url: `/books/searchBooks?searchValue=${value}&size=${size}`,
    signal: abortController.signal
})
